feat(PDRIVE-526, PDRIVE-687): add run_oc_command argument validation … - #110
feat(PDRIVE-526, PDRIVE-687): add run_oc_command argument validation …#110hoberger-rh wants to merge 1 commit into
Conversation
…and SafeCmdString pre-commit check Add _validate_args_safe() to OcApiUtils that validates all run_oc_command arguments against an allowlist of safe patterns (flags, resource names, JSONPath expressions, field selectors). Raises ValueError on invalid input. - Add mypy-based pre-commit hook to check SafeCmdString type usage (PDRIVE-687) - Add unit tests for _validate_args_safe() covering allowed patterns and edge cases - Add dynamic test that discovers all rule classes, executes their methods, and validates the actual args passed to run_oc_command against the allowlist - Enforce _validate_args_safe() in test mock (OperatorTestBase.run_oc_command) so future rule tests catch invalid args at test time Assisted-by: Claude Code (Claude Opus 4.6) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
=======================================
Coverage ? 87.21%
=======================================
Files ? 56
Lines ? 6541
Branches ? 0
=======================================
Hits ? 5705
Misses ? 836
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
feat(PDRIVE-526, PDRIVE-687): add run_oc_command argument validation and SafeCmdString pre-commit check
Add _validate_args_safe() to OcApiUtils that validates all run_oc_command
arguments against an allowlist of safe patterns (flags, resource names,
JSONPath expressions, field selectors). Raises ValueError on invalid input.
and edge cases
and validates the actual args passed to run_oc_command against the allowlist
so future rule tests catch invalid args at test time
Assisted-by: Claude Code (Claude Opus 4.6) noreply@anthropic.com